TITL DAI FIRMWARE 2E000-2E1FC V1.1 ORG :E000 * * * * ====================== *** SCREEN DRIVING PACKAGE *** * ====================== * * Called by RST 5; DATA XX. XX indicates the * offset of E000 for the different entrypoints. * *************** * ENTRYPOINTS * *************** * * Screen functions: REM ZSINIT JMP :E0C3 Initialise screen ZSOUTC JMP :E102 Output one character ZSCLT JMP :E237 Set text colours ZSCUS JMP :E279 Set cursor position ZSCUA JMP :E2CC Ask cursor position and REM size character screen ZSCUM JMP :E316 Set cursor mode ZSCUI JMP :E344 Flash cursor ZSFETC JMP :E38B Get character from line ZSMODE JMP :E3D9 Change mode ZSCLG JMP :E6A4 Set graphics colours ZSDOT JMP :E710 Draw a dot on the screen ZSDRAW JMP :E71B Draw a line on the screen ZSFILL JMP :E818 Fill a rectangular area ZSCRN JMP :E884 Ask colour of a point on the REM screen and the size of the REM graphics screen * Edit functions: REM ZEDIT JMP :EBF4 Initialise editor ZEDOB JMP :EC1E Run edit command * ************************* * CONSTANT TABLE MODE 0 * ************************* * * These constant tables are moved into the screen * variables in RAM (0084-0098) when the appropriate * mode is entered. * * Except the last 4 data blocks, all values * are offset from the screen top address (BFFF for * a 48K machine). This is valid for all modes. * CON0 DBL :0CB0 First free RAM byte DBL :0000 Top of rolled area DBL :0000 End graphics area DBL :0010 Start character area DBL :0CA0 End character area DBL :0CB0 End screen DBL :0000 End area used splitting mode DBL :0000 Start archive save area * DBL :0000 Number of blobs horizontally DATA :00 Number of lines of graphics DATA :00 Number saved graphics lines DATA :00 Number of bytes/line * **************************** * CONSTANT TABLE MODES 1/2 * **************************** * CON1 DBL :0638 First free RAM byte DBL :0130 Top area rolled up for mode DBL :0628 End graphics area DBL :0628 CHS (dummy) DBL :0860 End character area DBL :0638 End screen DBL :0748 End area used splitting mode DBL :0740 Start graphic archive area * DBL :0048 Number of blobs horizontally DATA :41 Number of lines of graphics DATA :0C Number archive area lines DATA :18 Number of bytes/line * ****************************** * CONSTANT TABLE MODES 1A/2A * ****************************** * CON1A DBL :0860 First free RAM byte DBL :0130 Top of rolled area DBL :0508 End graphics area DBL :0518 Start character area DBL :0730 End character area DBL :0740 End screen DBL :0748 End area used splitting mode DBL :0628 Start graph temp save area * DBL :0048 Number of blobs horizontally DATA :41 Number of lines of graphics DATA :0C Number saved graphics lines DATA :18 Number of bytes/line * **************************** * CONSTANT TABLE MODES 3/4 * **************************** * CON3 DBL :177C First free RAM byte DBL :0460 Top area rolled up DBL :176C End graphics area DBL :176C CHS (dummy) DBL :19A4 End character area DBL :177C End screen DBL :1BBC End area used splitting mode DBL :1554 Start graph archive area * DBL :00A0 Number of blobs horizontally DATA :82 Number of lines of graphics DATA :18 Number archive area lines DATA :2E Number of bytes/line * ****************************** * CONSTANT TABLE MODES 3A/4A * ****************************** * CON3A DBL :19A4 First free RAM byte DBL :0460 Top of rolled area DBL :131C End graphics area DBL :132C Start character area DBL :1544 End character area DBL :1554 End screen DBL :1BBC End area used splitting mode DBL :176C Start graph temp save area * DBL :00A0 Number of blobs horizontally DATA :82 Number of lines of graphics DATA :18 Number saved graphics lines DATA :2E Number of bytes/line * **************************** * CONSTANT TABLE MODES 5/6 * **************************** * CON5 DBL :5A20 First free RAM byte DBL :0F88 Top area rolled up DBL :5A10 End graphics area DBL :5A10 CHS (dummy) DBL :5C48 End character area DBL :5A20 End screen DBL :6988 End area used splitting mode DBL :4CD0 Start graph archive area * DBL :0150 Number of blobs horizontally DATA :00 Number of lines of graphics DATA :2C Number saved graphics lines DATA :5A Number of bytes/line * ****************************** * CONSTANT TABLE MODES 5A/6A * ****************************** * CON5A DBL :5C48 First free RAM byte DBL :0F88 Top of rolled area DBL :4A98 End graphics area DBL :4AA8 Start character area DBL :4CC0 End character area DBL :4CD0 End screen DBL :6988 End area used splitting mode DBL :5A10 Start graph temp save area * DBL :0150 Number of blobs horizontally DATA :00 Number of lines of graphics DATA :2C Number saved graphics lines DATA :5A Number of bytes/line * ********************* * INITIALISE SCREEN * ********************* * * The screen is initialised into all character * format (mode 0), and the cursor mode is set * and it is positioned in the top left corner. * The normal mode set routine is used (memory * management routine). * * This is the only time the package is told the * startaddress of the screen. The colour format * is as for SCOLT, SCOLG. The cursor format is * as for SCURM. * * Entry: HL: Top location screen RAM. * DE: Points to list with initialisation * parameters (start at C7E0). * Exit: All registers maybe corrupted. * SINIT SHLD :0080 Store startaddr screen PUSH D LXI D,:FFF0 DAD D SHLD :0082 Set top of screen POP H XRA A STA :009D Select mode 1 CALL :E316 Set cursor type + info INX H INX H CALL :E237 Init. colours COLORT DCR A STA :009D Select mode 0 LXI D,:0004 DAD D Get addr COLORG parameters CALL :E6A4 Init. colours COLORG DAD D Get addr screen management REM parameters MOV E,M ) INX H ) Get addr screen management MOV D,M ) routine INX H XCHG SHLD :00C4 Store addr SMKRM XCHG MOV E,M ) Get addr emergency INX H ) stop routine MOV D,M ) XCHG SHLD :00C6 Store addr em.stop routine MVI A,:10 STA :009D Select init. screen mode REM (no text, no graphics) MVI A,:FF CALL :E3D9 Set up screen for mode 0 RET * ******************************** * OUTPUT A CHARACTER TO SCREEN * ******************************** * * Displays one character on the screen. * * Entry: A: Character to be displayed. * Exit: ABCDEHL preserved. * CY=1: Character ignored. * SOUTC STC CY=1 PUSH PSW PUSH B PUSH D PUSH H CALL :E21C Change to char mode if REM not yet done LHLD :0072 Get cursor position CALL :E36B Delete cursor CPI :0D Car.ret ? JZ :E13D Then print it CPI :0C Form feed ? JZ :E159 Then clear screen CPI :08 Backspace ? JZ :E166 Then cancell last character PUSH PSW LDA :007A Get addr last byte on line CMP L Reached ? JZ :E1A9 Then extend lines OTC05 POP PSW MOV M,A Put char on screen DCX H DCX H Points to next screen loc OTC10 CALL :E330 Put cursor on screen * *OTC20 XRCC POP H POP D POP B POP PSW CMC CY=0: char accepted RET REM * If character not accepted: REM OTC25 POP PSW OTC26 CALL :E330 Put cursor on screen XRET POP H POP D POP B POP PSW CY=1: char ignored RET REM * If carriage return: REM OTC30 LHLD :0078 Get startaddr current line XCHG in DE LXI H,:FF7A DAD D Get startaddr next line XCHG in DE LHLD :008C Get end char area CALL :E6FB Check if end is reached XCHG Next line mode byte in HL CZ :E1CB If end reached: scroll up REM one line CZ :E1FD and init. this line with REM blanks OTC35 CALL :E687 Cursor on begin next line JMP :E12E Quit; char accepted REM * If form feed: REM OTC40 LHLD :008C Get end character area XCHG in DE LHLD :008A Get start character area CALL :E1FD Init screen with spaces JMP :E153 Cursor top left corner of REM char area; popall; ret REM * If backspace: REM OTC50 XCHG Cursor position in DE LHLD :0078 Get startaddr current line LXI B,:FFF8 Left border width DAD B Get addr 1st char on line CALL :E6FB Cursor at begin of line? XCHG JZ :E135 Then ignore char; abort INX H ) Cursor one location INX H ) backwards MVI M,:20 Load space in this location LDA :007B Get number of extended lines ORA A JZ :E12B If no cont line: put cursor REM on screen JM :E12B If char accepted: put REM cursor on screen REM * Backspace on a continuation line: REM PUSH D Save addr 1st byte on line REM on stack XCHG HL is cursor position LXI B,:FFF2 DAD B HL = end indent area CALL :E6FB Compare DE-HL XCHG POP D JNZ :E12B If not there: put cursor on REM screen; quit, char accepted XCHG MVI M,:20 Else cancel cont char (C) LXI H,:007B DCR M Decr. number extended lines LHLD :0078 Get startaddr current line LXI D,:0086 DAD D Pnts to start previous line CALL :E698 Store addr line mode byte as REM current one and set last REM byte on that line LXI D,:FF80 DAD D JMP :E12B Put cursor on screen; quit, REM char accepted REM * If end of line is reached: REM OTC80 LDA :007B Get number extended lines CPI :03 Max (3) reached ? JNC :E134 Then put cursor on screen, REM ret INR A Incr. number ext. lines MOV B,A Store it in B MVI A,:0D CALL :E102 Output car.ret MOV A,B STA :007B Update nr ext. lines LHLD :0072 Get cursor position addr CALL :E36B Delete cursor MVI M,:43 Print 'C' at left of line LXI D,:FFF2 DAD D Indent 6 pos JMP :E127 Store char on new pos; put REM cursor on screen * ************* * SCROLLING * ************* * * Scrolls up text area. Moves the character area of * the screen up one line. * Only the characters are moved, not the control and * colour bytes. * * Entry: None. * Exit: AF preserved, BC corrupted. * DE: End of bottom line. * HL: Start of bottom line. * SCROLL LXI B,:FF7A -86 (length one line) REM * Entry from Edit: * Scroll screen for number of positions given in * BC (-2 = 1 position left): REM SCR10 PUSH PSW LHLD :008A Get startaddr character area MOV D,H ) and store it in DE MOV E,L ) DAD B Get addr line mode byte REM next line XCHG in DE SCR20 LXI B,:FFF8 DAD B Get 1st useable location REM on 1st line XCHG in DE DAD B Get 1st useable location REM on 2nd line XCHG in DE; 1st line in HL MVI B,:3C max 60 characters SCR30 LDAX D Get char from 2nd line MOV M,A and move it to 1st line DCX D DCX D Next char 2nd line DCX H DCX H Next loc 1st line DCR B JNZ :E1DF Next char to be moved 1 line LXI B,:FFFA DAD B Get addr line mode byte REM 2nd line XCHG in DE DAD B Get addr line mode byte REM 3rd line XCHG in DE; 2nd line in HL PUSH H LHLD :008C Get addr end character area CALL :E6FB Check if end reached POP H JC :E1D6 If not at end: scroll next REM line POP PSW RET * * * UNL OTC20 EQU XRCC LST END